import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class editorHandler implements LoginHandler {
    @Override
    public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String student_id = request.getParameter("student_id");
        System.out.println(student_id);

        // 获取学生ID
        String student_name = new String(request.getParameter("student_name").getBytes("ISO-8859-1"), "UTF-8");
        String student_age = request.getParameter("student_age");

        System.out.println(student_id);
        System.out.println(student_name);
        System.out.println(student_age);

        request.setAttribute("username", "编辑");

        // 或者将学生信息传递到编辑页面
        request.setAttribute("student_id", student_id);
        request.setAttribute("student_name", student_name);
        request.setAttribute("student_age", student_age);
        request.getRequestDispatcher("/login.jsp").forward(request, response);

    }
}
